package com.shine.demo.jvm.tuning;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.LinkedList;
import java.util.List;

@Data
@AllArgsConstructor
public class User {
    public static List<User> list = new LinkedList<>();
    private Integer id;
    private String uid;

    @Override
    protected void finalize() throws Throwable {
        System.err.println("对象id:"+this.id+"将被回收");
        User.list.add(this);
    }
}
